package com.zxq.protocol.entity;


import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

/**
 * 产品表--选择传输协议和数据解析协议
 * @TableName iot_product
 */
@TableName(value ="iot_product")
@Data
public class IotProductDo implements Serializable {
    /**
     * 主键
     */
    @TableId
    private Long id;

    /**
     * 产品名称
     */
    private String name;

    /**
     * 传输端口
     */
    private Integer transferPort;

    /**
     * 上报地址，无回复
     */
    private String reportUrl;

    /**
     * 请求地址，有回复
     */
    private String requestUrl;

    /**
     * 传输协议
     */
    private Long protocolTransferId;

    /**
     * 数据协议
     */
    private Long protocolDataId;

    /**
     * 设备单价（xx元/一个一天）
     */
    private BigDecimal deviceUnitPrice;

    /**
     * 使用时间
     */
    private Long days;

    /**
     * 最大数量
     */
    private Long deviceCount;

    /**
     * 创建人
     */
    private Long creator;

    /**
     * 创建时间
     */
    private Date createDate;

    /**
     * 更新人
     */
    private Long updater;

    /**
     * 更新时间
     */
    private Date updateDate;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        IotProductDo other = (IotProductDo) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getTransferPort() == null ? other.getTransferPort() == null : this.getTransferPort().equals(other.getTransferPort()))
            && (this.getReportUrl() == null ? other.getReportUrl() == null : this.getReportUrl().equals(other.getReportUrl()))
            && (this.getRequestUrl() == null ? other.getRequestUrl() == null : this.getRequestUrl().equals(other.getRequestUrl()))
            && (this.getProtocolTransferId() == null ? other.getProtocolTransferId() == null : this.getProtocolTransferId().equals(other.getProtocolTransferId()))
            && (this.getProtocolDataId() == null ? other.getProtocolDataId() == null : this.getProtocolDataId().equals(other.getProtocolDataId()))
            && (this.getDeviceUnitPrice() == null ? other.getDeviceUnitPrice() == null : this.getDeviceUnitPrice().equals(other.getDeviceUnitPrice()))
            && (this.getDays() == null ? other.getDays() == null : this.getDays().equals(other.getDays()))
            && (this.getDeviceCount() == null ? other.getDeviceCount() == null : this.getDeviceCount().equals(other.getDeviceCount()))
            && (this.getCreator() == null ? other.getCreator() == null : this.getCreator().equals(other.getCreator()))
            && (this.getCreateDate() == null ? other.getCreateDate() == null : this.getCreateDate().equals(other.getCreateDate()))
            && (this.getUpdater() == null ? other.getUpdater() == null : this.getUpdater().equals(other.getUpdater()))
            && (this.getUpdateDate() == null ? other.getUpdateDate() == null : this.getUpdateDate().equals(other.getUpdateDate()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getTransferPort() == null) ? 0 : getTransferPort().hashCode());
        result = prime * result + ((getReportUrl() == null) ? 0 : getReportUrl().hashCode());
        result = prime * result + ((getRequestUrl() == null) ? 0 : getRequestUrl().hashCode());
        result = prime * result + ((getProtocolTransferId() == null) ? 0 : getProtocolTransferId().hashCode());
        result = prime * result + ((getProtocolDataId() == null) ? 0 : getProtocolDataId().hashCode());
        result = prime * result + ((getDeviceUnitPrice() == null) ? 0 : getDeviceUnitPrice().hashCode());
        result = prime * result + ((getDays() == null) ? 0 : getDays().hashCode());
        result = prime * result + ((getDeviceCount() == null) ? 0 : getDeviceCount().hashCode());
        result = prime * result + ((getCreator() == null) ? 0 : getCreator().hashCode());
        result = prime * result + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode());
        result = prime * result + ((getUpdater() == null) ? 0 : getUpdater().hashCode());
        result = prime * result + ((getUpdateDate() == null) ? 0 : getUpdateDate().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", transferPort=").append(transferPort);
        sb.append(", reportUrl=").append(reportUrl);
        sb.append(", requestUrl=").append(requestUrl);
        sb.append(", protocolTransferId=").append(protocolTransferId);
        sb.append(", protocolDataId=").append(protocolDataId);
        sb.append(", deviceUnitPrice=").append(deviceUnitPrice);
        sb.append(", days=").append(days);
        sb.append(", deviceCount=").append(deviceCount);
        sb.append(", creator=").append(creator);
        sb.append(", createDate=").append(createDate);
        sb.append(", updater=").append(updater);
        sb.append(", updateDate=").append(updateDate);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}